<template>
  <view>
    <view class="cu-bar bg-white search fixed"
          :style="[{top:CustomBar + 'px'}]">
      <view class="search-form round">
        <text class="cuIcon-search"></text>
        <input type="text" v-model="searchTxt" placeholder="输入产品名称"
               confirm-type="search"/>
      </view>
      <view class="action">
        <button class="cu-btn round text-custom-bg text-white"
                @tap.stop="searchMsgList">搜索</button>
      </view>
    </view>
    <scroll-view scroll-y class="indexes">
      <view class="cu-list menu-avatar ">
        <block v-for="(item,index) in msgList" :key="index">
          <verify-order-one-list :verifyOrder="item"></verify-order-one-list>
        </block>
      </view>
      <view class="text-center padding text-gray">~~~~我是有底线的~~~~</view>
    </scroll-view>
  </view>
</template>

<script setup lang="ts">
import {onReachBottom, onLoad} from "@dcloudio/uni-app";
import {useStore} from "@/common/store";
import {computed, onMounted, ref} from "vue";
import {adminVerifyList} from "@/common/api/order";
import OrderOneList from "../../components/OrderOneList.vue";
import VerifyOrderOneList from "../../components/VerifyOrderOneList.vue";

const store = useStore();

const token = computed(() => store.token)
const userId = computed(() => store.userId)
const CustomBar = ref(0)
const msgList = ref([])
const searchTxt = ref('')


const initMsgList = (value: string) => {
  adminVerifyList(userId.value ||0).then(res => {
    msgList.value = res.data;
  })
}

const searchMsgList = () => {
  initMsgList(searchTxt.value);
}

onLoad((options) =>{
})

onMounted(async () => {
  initMsgList('');
})
</script>

<style>
.indexes {
  height: 70vh;
  margin-top: 50px;
}

</style>
